const app = getApp();
const accountInfo = wx.getAccountInfoSync();

Page({
  options: {
    addGlobalClass: true,
  },
  data: {

  },

  onShow() {

  },
  scanQrcode: function () {
    wx.scanCode({
      onlyFromCamera: true,
      success: function (res) {
        console.log("res", res);
        wx.navigateTo({
          url: '/pages/scroll-check/scroll-check?paperId=' + res.result,
        });
      }
    })
  },
  handInput: function () {
    //弹窗输入情况
    wx.showModal({
      editable: true, //显示输入框
      placeholderText: '请输入原纸 ID', //显示输入框提示信息
      success: res => {
        if (res.confirm) { //点击了确认
          console.log(res.content) //用户输入的值
          if (!res.content) {
            wx.showModal({
              title: '提示',
              content: "原纸 ID不能为空",
              showCancel: false
            })
            return;
          } else {
            wx.showLoading({
              title: '加载中',
            });
            // 模拟异步操作，例如数据获取
            setTimeout(() => {
              wx.hideLoading(); // 隐藏加载提示
              wx.navigateTo({
                url: '/pages/scroll-check/scroll-check?paperId=' + res.content,
              });
            }, 500);
          }
        }
      }
    })
  },


})